pacman::p_load(stringr, tidyverse, tidytable, purrr, ggplot2)
all <- TRUE
if(all) {
params <- "k40_var0.05"
dtm_run_path <-
"coal_output/dtm/run_21Sep//all_2a_min_freq_150_21_09_21/"
docs_file <- "id_alliance_all_2a.csv"
elec_period <- 1901:2020
minimum_display_year <- 1900
} else {
params <- "k25_var0.05"
dtm_run_path <-
"coal_output/dtm/run_21Sep//all_2a_last_20_years_min_freq_80_21_09_21/"
docs_file <- "id_alliance_last20_2a.csv"
elec_period <- 2000:2020
minimum_display_year <- 2000
}
main_eras <- c(1935, 1963, 2005)
input_df %>%
count.(final_alliance)
input_df %>%
count.(final_alliance)
dividing the counts of paragraphs discussing coal by the number of bills passed in parliament that year as a proxy for parliamentary activity. The results are then normalised so that 1 corresponds to the largest amount of discussion by any party, which corresponds to the Greens in 2019. Parliament has arguably become more active over time in part due to an increase in the number of MPs and Senators and in part due to the increased requirements of a larger population and a more complex economy.
With those differences taken into account, the periods between 1940 and 1960 and post-2005 stand out, corresponding respectively to
largest amount of discussionyears above the 80% value: 1902, 1918, 1920, 1921, 1926, 1929, 1932, 1933, 1938, 1940, 1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1955, 1956, 1957, 1958, 1959, 1961, 1962, 1977, 1982, 1994, 2001, 2006, 2007, 2008, 2009, 2011, 2012, 2013, 2014, 2015, 2017, 2018, 2019
filtering the minimal part of “other” in the period prior to 1975 and in general any topic before 1910 because the amounts of information are tiny and lead to wild fluctuations in proportion.
# From this article https://www.blueprintinstitute.org.au/polling_data
coal_mining_regions <- "Kalgoorlie|Parkes|Lyne|Hunter|calare|shortland|Flynn|Maranoa|gippsland|connor|capricornia"
combined_df <- input_df %>%
select.(doc_id, electorate, final_alliance, year) %>%
left_join.(select.(topic_distributions, -c(V1, year))) %>%
pivot_longer.(c(`0`:sym(topic_nums)), names_to = "topic_no", values_to = "score") %>%
mutate.(topic_no = as.integer(topic_no)) %>%
left_join.(topic_labels) %>%
left_join.(select(elections, year, era, legislature)) %>%
filter.(year > minimum_display_year,
!(final_alliance == "Other" & year < 1975)) %>%
mutate.(label = paste0(str_pad(topic_no, 2, "left", "0"), "_", label),
mining_region = str_detect(electorate, regex(coal_mining_regions, ignore_case = T)))
(Replicating MH’s Fig. 10)
Differences range: -3.218287 6.038361
Differences range: -9.190999 20.52203
best used to “confirm” that we’re not selecting the wrong thing.
00_searborne transport01_national procurement
02_electorate
04_carbon price
05_production and regions
06_coal supply
07_QLD and WA resources
08_elections & policy
09_budget
10_committee on coal impacts
11_natural disasters (GBR)
12_fed vs states (JCB)
13_trade partners (UK, JPN, CHN)
14_renewable energy projects
15_export
16_research
17_welfare
18_big business (Adani)
19_fed vs states (JCB)
20_water and farming
21_arbitration
22_employee entitlements
23_excise and duties
24_nuclear power
26_taxes
27_coalminers
28_commissions and committees
29_other fuels
30_employment
31_production
32_electricity generation
33_Asian opportunities
34_infrastructure
35_bills and measures
36_industrial relations
37_iron and steel
39_climate change
00_searborne transport01_national procurement
02_electorate
04_carbon price
05_production and regions
06_coal supply
07_QLD and WA resources
08_elections & policy
09_budget
10_committee on coal impacts
11_natural disasters (GBR)
12_fed vs states (JCB)
13_trade partners (UK, JPN, CHN)
14_renewable energy projects
15_export
16_research
17_welfare
18_big business (Adani)
19_fed vs states (JCB)
20_water and farming
21_arbitration
22_employee entitlements
23_excise and duties
24_nuclear power
26_taxes
27_coalminers
28_commissions and committees
29_other fuels
30_employment
31_production
32_electricity generation
33_Asian opportunities
34_infrastructure
35_bills and measures
36_industrial relations
37_iron and steel
39_climate change